<?php
	/*
	 * AJAX call to save a content filter into the database.
	 * Filters are stored in the table "filerwords".
	 *
	 * Variables:
	 *   txt (string) : the word
	 *
	 * Returns: string (error or html code)
	 *
	 */

	$sql = mysql_query("INSERT INTO filterwords SET fwText=\"".mysql_real_escape_string(stripslashes($_GET["txt"]))."\", fwEnterDate=NOW()");
	if(mysql_error() != ""){
		echo mysql_error();
	}else{
		echo '<div id="filtword'.mysql_insert_id().'" class="listdiv">';
		echo '<a style="float:right" href="javascript:delfiltword('.mysql_insert_id().')"><img src="'.$url_prefix.'images/cross.png" /></a>';
		echo mysql_real_escape_string(stripslashes($_GET["txt"]));
		echo '</div>';
	}
	exit;
?>